#include "led.h"
#include "key.h"
#include "delay.h"
#include "usart.h"
#include <string.h>

uint8_t buffer[100]            = {0};
uint8_t size                   = 0;
uint8_t receive_one_frame_flag = 0;

int main(void)
{
    // 初始化
    USART_Init();

    // 发送单个字符
    USART_SendChar('a');
    USART_SendChar('t');
    USART_SendChar('\n');

    // 发送字符串
    uint8_t *str = "program start!\n";
    USART_SendString(str, strlen((char *)str));

    while(1)
    {
        if (receive_one_frame_flag)
        {
            USART_SendString(buffer, size);

            // 清除标志
            receive_one_frame_flag = 0;
            size                   = 0;
        }
    }
}
